Skip to content

fix: remove output fields subsumed by primitiveVars to prevent duplic…#1948

Merged
NasserFlexCompute merged 3 commits intomainfrom
nasser/duplicatedPrimitiveOutput
Apr 2, 2026
Merged

fix: remove output fields subsumed by primitiveVars to prevent duplic…#1948
NasserFlexCompute merged 3 commits intomainfrom
nasser/duplicatedPrimitiveOutput

Conversation

@NasserFlexCompute
Copy link
Copy Markdown
Contributor

@NasserFlexCompute NasserFlexCompute commented Mar 31, 2026

…ate VTK DataArray names

When both "primitiveVars" and "pressure"/"velocity" are in outputFields, the C++ FieldProcessor produces duplicate DataArray names ("p", "velocity") in VTK output. This causes ParaView to fail when loading a subset of fields.

Strip "pressure" and "velocity" from the translated outputFields when "primitiveVars" is already present, since primitiveVars expands to rho + velocity + p in the solver.

Made-with: Cursor


Note

Medium Risk
Changes solver JSON translation for outputFields by removing pressure/velocity when primitiveVars is present, which could affect downstream expectations of exact field lists despite being redundant. Risk is limited to output configuration/VTK export behavior and covered by added/updated tests.

Overview
Prevents duplicate VTK DataArray names by stripping pressure and velocity from translated outputFields whenever primitiveVars is also requested (since primitiveVars already expands to rho, velocity, and p).

Adds remove_fields_subsumed_by_primitive_vars() in output_fields.py and applies it during output-field translation in solver_translator.py, with new unit tests and updated translation expectations (notably removing velocity from volume output cases that include primitiveVars).

Written by Cursor Bugbot for commit 72998ad. This will update automatically on new commits. Configure here.

…ate VTK DataArray names

When both "primitiveVars" and "pressure"/"velocity" are in outputFields,
the C++ FieldProcessor produces duplicate DataArray names ("p", "velocity")
in VTK output. This causes ParaView to fail when loading a subset of fields.

Strip "pressure" and "velocity" from the translated outputFields when
"primitiveVars" is already present, since primitiveVars expands to
rho + velocity + p in the solver.

Made-with: Cursor
Copilot AI review requested due to automatic review settings March 31, 2026 20:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates output-field translation to avoid duplicate VTK DataArray names when primitiveVars is selected alongside fields it already expands to (notably pressure/velocity), which can break ParaView loading.

Changes:

  • Added remove_fields_subsumed_by_primitive_vars() to strip pressure/velocity when primitiveVars is present.
  • Applied this filter in translate_output_fields() during solver JSON translation.
  • Added unit tests for the new filtering helper.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
flow360/component/simulation/outputs/output_fields.py Introduces helper to remove fields subsumed by primitiveVars to prevent duplicate VTK arrays.
flow360/component/simulation/translator/solver_translator.py Calls the new helper when translating non-volume output field lists.
tests/simulation/outputs/test_output_fields.py Adds direct unit tests for the helper behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

translate_volume_output() builds outputFields independently of
translate_output_fields(), so it was missing the
remove_fields_subsumed_by_primitive_vars() call. Apply the same
filter and update volume output translation test expectations.

Made-with: Cursor
@NasserFlexCompute NasserFlexCompute enabled auto-merge (squash) March 31, 2026 20:57
Copilot AI review requested due to automatic review settings April 2, 2026 17:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants